package com.zzxx.exam.ui;

import com.zzxx.exam.entity.EntityContext;
import com.zzxx.exam.service.Controller;

import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        ClientContext clientContext = new ClientContext();
        EntityContext entityContext = new EntityContext();
        LoginFrame loginFrame = new LoginFrame();
        MenuFrame menuFrame = new MenuFrame();
        WelcomeWindow welcomeWindow = new WelcomeWindow();
        ExamFrame examFrame = new ExamFrame();
        MsgFrame msgFrame = new MsgFrame();
        ResultFrame resultFrame = new ResultFrame();
        Controller controller = new Controller();


        clientContext.setLoginFrame(loginFrame);
        clientContext.setMenuFrame(menuFrame);
        clientContext.setWelcomeWindow(welcomeWindow);
        clientContext.setExamFrame(examFrame);
        clientContext.setMsgFrame(msgFrame);
        clientContext.setResultFrame(resultFrame);
        clientContext.setController(controller);

        loginFrame.setClientContext(clientContext);

        menuFrame.setClientContext(clientContext);
        menuFrame.setExamFrame(examFrame);
        menuFrame.setMsgFrame(msgFrame);

        examFrame.setClientContext(clientContext);

        msgFrame.setClientContext(clientContext);

        resultFrame.setClientContext(clientContext);

        controller.setEntityContext(entityContext);
        controller.setClientContext(clientContext);

        clientContext.showView();

//        entityContext.userReader();
//        entityContext.questionReader();
//        entityContext.rulesReader();

    }
}
